home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / lib / firefox-3.0.14 / chrome / browser.jar / content / browser / places / places.xml < prev    next >
Encoding:
Extensible Markup Language  |  2008-03-29  |  3.2 KB  |  95 lines

  1. <?xml version="1.0"?>
  2.  
  3. <bindings id="placesBindings"
  4.           xmlns="http://www.mozilla.org/xbl"
  5.           xmlns:xbl="http://www.mozilla.org/xbl"
  6.           xmlns:html="http://www.w3.org/1999/xhtml"
  7.           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  8.   
  9.   <!-- XXXben - replace this upon checkin by allowing generic textboxes to show
  10.                 arbitrary content before the html:input itself using a 
  11.                 <children/> -->
  12.   <binding id="textbox-timed-arbitrary"
  13.            extends="chrome://global/content/bindings/textbox.xml#timed-textbox">
  14.     <resources>
  15.       <stylesheet src="chrome://browser/skin/places/places.css"/>
  16.     </resources>
  17.     <content>
  18.       <children/>
  19.       <xul:hbox class="textbox-input-box" flex="1" xbl:inherits="context">
  20.         <html:input class="textbox-input" flex="1" anonid="input"
  21.                     xbl:inherits="onfocus,onblur,value,type,maxlength,disabled,size,readonly,tabindex,accesskey"/>
  22.       </xul:hbox>
  23.       <xul:hbox>
  24.         <xul:button class="textbox-input-closebutton"/>
  25.       </xul:hbox>
  26.     </content>
  27.     <implementation>
  28.       <method name="reset">
  29.         <body><![CDATA[ 
  30.           this.removeAttribute("filtered");
  31.         ]]></body>
  32.       </method>
  33.       <method name="_resetInternal">
  34.         <body><![CDATA[ 
  35.           this.value = "";
  36.           this.reset();
  37.  
  38.           var event = document.createEvent("Events");
  39.           event.initEvent("reset", true, true);
  40.  
  41.           var cancel = !this.dispatchEvent(event);
  42.           var handler = this.getAttribute("onreset");
  43.           if (handler) {
  44.             var handlerFunction = new Function("event", handler);
  45.             handlerFunction(event);
  46.           }
  47.         ]]></body>
  48.       </method>
  49.     </implementation>
  50.     <handlers>
  51.       <handler event="click"><![CDATA[ 
  52.         if (event.originalTarget.className == "textbox-input-closebutton") {
  53.           this.inputField.focus();
  54.           this._resetInternal();
  55.         }
  56.       ]]></handler>
  57.       <handler event="keypress" keycode="VK_ESCAPE"><![CDATA[ 
  58.         this._resetInternal();
  59.       ]]></handler>
  60.     </handlers>
  61.   </binding>
  62.   
  63.   <binding id="command-button" extends="chrome://global/content/bindings/button.xml#button">
  64.     <implementation>
  65.       <method name="updateActiveView">
  66.         <body><![CDATA[ 
  67.           if (this.hasAttribute("view"))
  68.             PlacesController.activeView = document.getElementById(this.getAttribute("view"));
  69.         ]]></body>
  70.       </method>
  71.     </implementation>
  72.     <handlers>
  73.       <handler event="click" button="0" action="this.updateActiveView();"/>
  74.       <handler event="keypress" keycode="VK_SPACE" action="this.updateActiveView();"/>
  75.     </handlers>
  76.   </binding>
  77.   
  78.   <binding id="filter-button" extends="chrome://global/content/bindings/button.xml#menu">
  79.     <content>
  80.       <xul:stack flex="1" class="box-inherit button-box">
  81.         <xul:image class="button-icon" xbl:inherits="src=image"/>
  82.         <xul:dropmarker class="button-menu-dropmarker" xbl:inherits="open,disabled"/>
  83.       </xul:stack>
  84.       <children includes="menupopup"/>
  85.     </content>
  86.     <handlers>
  87.       <handler event="command"><![CDATA[
  88.         PlacesSearchBox.filterCollection = event.target.getAttribute("value");
  89.       ]]></handler>
  90.     </handlers>
  91.   </binding>
  92.  
  93.   
  94. </bindings>
  95.